﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Gift.DAL;
using Gift.Model;

namespace WebSite.admin.product
{
    public partial class comment_manage_replay : BaseAdmin
    {
        readonly DALComment theComment = new DALComment();
        tbComment oComment;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.BuildForm();
            }
        }

        void BuildForm()
        {
            oComment = theComment.GetModel(int.Parse(Request.QueryString["cid"]));
            this.lblTitle.Text = oComment.title;

        }

        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            oComment = theComment.GetModel(int.Parse(Request.QueryString["cid"]));
            oComment.replay = this.txtReplay.Text.Trim();
            oComment.replayid = base.AdminUserId;
            oComment.replaytime = DateTime.Now;
            oComment.states = true;
            theComment.Update(oComment);
            ExtAspNet.Alert.Show("保存成功！");
            ExtAspNet.PageContext.RegisterStartupScript(ExtAspNet.ActiveWindow.GetHidePostBackReference());
        }
    }
}